package com.example.controller;

import com.example.service.IShiftPhaseService;
import com.example.vo.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 班次阶段表 前端控制器
 * </p>
 *
 * @author wsl
 * @since 2022-04-14
 */
@RestController
@RequestMapping("/shiftPhase")
@Api(tags = "班次阶段表",value = "")
@CrossOrigin(allowCredentials = "true")
public class ShiftPhaseController {

    @Autowired
    private IShiftPhaseService isps;

    @PutMapping("/zero/{ids}")
    @ApiModelProperty("修改状态")
    public ResultVo uptBySidZero(@PathVariable("ids") Integer[] ids){
        if(ids != null && ids.length != 0){
            isps.uptZero(ids);
            return ResultVo.ok();
        }
        return ResultVo.error();
    }

    @PutMapping("/one/{ids}")
    @ApiModelProperty("修改状态")
    public ResultVo uptBySidOne(@PathVariable("ids") Integer[] ids){
      if(ids != null && ids.length != 0){
          isps.uptOne(ids);
          return ResultVo.ok();
      }
      return ResultVo.error();
    }

}